-
Notifications
You must be signed in to change notification settings - Fork 1.5k
[PM-24128] New Pin service, using PasswordProtectedKeyEnvelope #15863
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
# Conflicts: # libs/common/src/platform/services/sdk/default-sdk.service.ts
|
Great job! No new security vulnerabilities introduced in this pull request |
# Conflicts: # libs/common/src/platform/services/sdk/default-sdk.service.ts # libs/common/src/vault/models/domain/cipher.ts # libs/common/src/vault/models/view/cipher.view.ts
|
PR has been updated to include a separate PinStateService to resolve a DI cycle. The DI cycle here is still an issue for KM and requires further work (possibly in other team's code), but it no longer blocks this specific PR. |
…lients into km/new-pin-service-interface
JaredSnider-Bitwarden
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Auth files still look good!
Thomas-Avery
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM
1e9b416
47a5e60
|
Changes in this PR impact the Autofill experience of the browser clientBIT has tested the core experience with these changes and the feature flag configuration used by ✅ Fortunately, these BIT tests have passed! 🎉 |
Changes in this PR impact the Autofill experience of the browser clientBIT has tested the core experience with these changes and all feature flags disabled. ✅ Fortunately, these BIT tests have passed! 🎉 |




🎟️ Tracking
https://bitwarden.atlassian.net/browse/PM-24128
📔 Objective
This migrates PIN service to use the new password-protected key envelope. For ephemeral PINs, support for the old format is immediately dropped, except for migrations of existing persistent PINs, which are migrated.
Overall, this both migrates to the new encryption primitive, but also simplifies the interface of the PIN service, no longer leaking the encryption details out of the service. You only provide userid / PIN, as the consumer, but the cryptographic details are hidden in the service.
Ephemeral PINs
For ephemeral PINs, support for the old format is immediately dropped, and a new state is introduced. This is fine and requires no migration, because the ephemeral PinProtectedKeyEnvelope is generated from the pin after unlock every time.
Persistent PINs
For persistent PINs, the same mechanism as for ephemeral PINs is used to migrate to the new PIN format, if the old format is detected. The PIN is used to create a new envelope, which is saved to disk, and the old states are wiped.
📸 Screenshots
Ephemeral PIN - First APP boot:
Screen.Recording.2025-08-01.at.15.16.26.mov
Ephemeral PIN - Setup
Screen.Recording.2025-08-01.at.15.15.35.mov
Persistent PIN - Setup
Screen.Recording.2025-08-01.at.15.21.30.mov
Legacy Persistent PIN - Migrate
Screen.Recording.2025-08-01.at.15.14.23.mov
⏰ Reminders before review
🦮 Reviewer guidelines
:+1:) or similar for great changes:memo:) or ℹ️ (:information_source:) for notes or general info:question:) for questions:thinking:) or 💭 (:thought_balloon:) for more open inquiry that's not quite a confirmed issue and could potentially benefit from discussion:art:) for suggestions / improvements:x:) or:warning:) for more significant problems or concerns needing attention:seedling:) or ♻️ (:recycle:) for future improvements or indications of technical debt:pick:) for minor or nitpick changes